<?php

$arr = [
    "type" => "send",
    "path" => "/d/d/d/d/d.txt",
    "name" => "d.txt",
    "result" => 1
];


$str = json_encode($arr);
var_dump($str);


$str = "{'type':'send','path':'\/d\/d\/d\/d\/d.txt','name':'d.txt','result':1}";
$str = '{"type":"send","path":"\/d\/d\/d\/d\/d.txt","name":"d.txt","result":1}';
$str = '{"type":"send","path":"/d/d/d/d/d.txt","name":"d.txt","result":1}';
$arr = json_decode($str);
echo $str.PHP_EOL;
var_dump($arr);

$str = "{\"type\":\"send\",\"faf\":\"faf\"}";
// $str = "{'type':'send','path':'\/d\/d\/d\/d\/d.txt','name':'d.txt','result':1}";
$arr = json_decode($str);
var_dump($arr);